/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.compomics.spectral.utilities.dataprovider.prideXML.errors.enums;

/**
 *
 * @author Kenneth
 */
public enum ConversionError {

//TODO MAKE A DEFINATE LIST, NOW WE ARE NOT USING ALL OF THIS
    SPECTRA_MISSING(0, "No spectra were found", SeverityLevel.WARNING),
    SPECTRA_MALFORMED(1, "Spectra are malformed", SeverityLevel.WARNING),
    PRECURSORS_MISSING(2, "No precursors were found", SeverityLevel.WARNING),
    PRECURSORS_MALFORMED(3, "Precursors are malformed", SeverityLevel.WARNING),
    PRECURSORS_MZ_MISSING(4, "No precursor M/Z-values were found", SeverityLevel.WARNING),
    PRECURSORS_MZ_MALFORMED(5, "Precursor M/Z-values are malformed", SeverityLevel.WARNING),
    PRECURSORS_INTENSITY_MISSING(6, "No precursor intensities were found", SeverityLevel.WARNING),
    PRECURSORS_INTENSITY_MALFORMED(7, "Precursor intensities are malformed", SeverityLevel.WARNING),
    CHARGES_MISSING(8, "No charges were found", SeverityLevel.WARNING),//the pipeline takes care of this usually
    CHARGES_MALFORMED(9, "Charges are malformed. This might cause errors during calculation !", SeverityLevel.WARNING),
    SPECTRUM_MZ_MISSING(10, "This spectrum has no M/Z values", SeverityLevel.TOLERABLE),
    SPECTRUM_INTENSITY_MISSING(11, "This spectrum has no intensity values", SeverityLevel.TOLERABLE),
    SPECTRUM_MS2_MISSING(12, "There are no usable MS2-level spectra", SeverityLevel.WARNING),
    UNKNOWN_MISSING_PARAMETER(13, "One of the parameters turned out to be null", SeverityLevel.WARNING),
    SPECTRUM_MISSING(14, "One of the spectra is missing", SeverityLevel.WARNING);
    private final int code;
    private final String description;
    private final SeverityLevel severityLv;

    private ConversionError(int code, String description, SeverityLevel severityLv) {
        this.code = code;
        this.description = description;
        this.severityLv = severityLv;
    }

    public String getDescription() {
        return description;
    }

    public int getCode() {
        return code;
    }

    public String getSeverityLevel() {
        return severityLv.name();
    }

    @Override
    public String toString() {
        return code + ": " + description;
    }

    private enum SeverityLevel {

        TOLERABLE, WARNING, FATAL
    }
}
